{% load static %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="{% static 'easyui/themes/default/easyui.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'easyui/themes/icon.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'easyui/demo/demo.css' %}">
    <script type="text/javascript" src="{% static 'easyui/jquery.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'easyui/jquery.easyui.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/test_menu.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/easyui_utils.js' %}"></script>
</head>
<body class="easyui-layout">
<div data-options="region:'west',split:true,title:'菜单'" style="width:200px;">
    <div id="sm" style="width: 100%;"></div>
</div>
<div id="center" data-options="region:'center',title:'数据'">
    {#    <div id="p_ops_list" class="easyui-panel" style="width: 100%;height: 100%"#}
    {#         data-options="closable:true, collapsible:true,minimizable:true,maximizable:true">#}
    {#        <input id="ss_ops" style="width:300px">#}
    {#        <div id="mm_ops" style="width:120px"></div>#}
    {#        <table id="dg_ops"></table>#}
    {#    </div>#}
    {#    <div id="p_sales_list" class="easyui-panel" style="width: 100%;height: 100%"#}
    {#         data-options="closable:true, collapsible:true,minimizable:true,maximizable:true">#}
    {#        <input id="ss_sales" style="width:300px">#}
    {#        <div id="mm_sales" style="width:120px">#}
    {#        </div>#}
    {#        <table id="dg_sales"></table>#}
    {#    </div>#}
    {#    <div id="p_sales_list" class="easyui-panel" style="width: 100%;height: 100%"#}
    {#         data-options="closable:true, collapsible:true,minimizable:true,maximizable:true">#}
    {#        <input id="ss_sales" style="width:300px">#}
    {#        <div id="mm_sales" style="width:120px">#}
    {#        </div>#}
    {#        <table id="dg_sales"></table>#}
    {#    </div>#}

</div>

<script type="text/javascript">
    $(function () {
        var panel_parent_id = "center"
        var menu_data = [{
            text: '人员管理',
            iconCls: 'icon-sum',
            state: 'open',
            children: [{
                text: '运营列表',
                panel_id: "p_ops_list",
                datagrid: {
                    id: "dg_ops",
                    url: '/easy_ui/test_menu_data',
                    columns: [[
                        {field: 'itemid', title: 'Item ID', width: 80},
                        {field: 'productid', title: 'Product ID', width: 120},
                        {field: 'listprice', title: 'List Price', width: 80, align: 'right'},
                        {field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right'},
                        {field: 'attr1', title: 'Attribute', width: 250},
                        {field: 'status', title: 'Status', width: 60, align: 'center'}
                    ]],
                    toolbar: [{
                        text: 'Add',
                        iconCls: 'icon-add',
                        handler: function () {
                            let url = "/easy_ui/data_list_page/"
                            let title = "数据列表"
                            let buttons = [{
                                text: 'Ok',
                                iconCls: 'icon-ok',
                                handler: function () {
                                    alert('ok');
                                }
                            }, {
                                text: 'Cancel',
                                handler: function () {
                                    alert('cancel');
                                }
                            }];
                            add_ops_dialog(panel_parent_id, "iframe_add_ops", url, title, buttons)
                        },

                    }, '-', {
                        text: 'Save',
                        iconCls: 'icon-save',
                        handler: function () {
                            alert('save')
                        }
                    }]
                },
                searchbox: {
                    id: "ss_ops",
                    menu_id: "mm_ops",
                    table_id: "dg_ops",
                    select_data: [
                        {name: "new", value: "select_ops"},
                        {name: "sport", value: "sport_ops"},
                    ]
                }
            }, {
                text: '销售列表',
                panel_id: "p_sales_list",
                datagrid: {
                    id: "dg_sales",
                    url: '/easy_ui/test_menu_data',
                    columns: [[
                        {field: 'itemid', title: 'Item ID', width: 80},
                        {field: 'productid', title: 'Product ID', width: 120},
                        {field: 'listprice', title: 'List Price', width: 80, align: 'right'},
                        {field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right'},
                        {field: 'attr1', title: 'Attribute', width: 250},
                        {field: 'status', title: 'Status', width: 60, align: 'center'}
                    ]],
                },
                searchbox: {
                    id: "ss_sales",
                    menu_id: "mm_sales",
                    table_id: "dg_sales",
                    select_data: [
                        {name: "new", value: "select_sales"},
                        {name: "sport", value: "sport_sales"},
                    ]
                },
            }, {
                text: '服务列表',
                panel_id: "p_service_list",
                datagrid: {
                    id: "dg_service",
                    url: '/easy_ui/test_menu_data',
                    columns: [[
                        {field: 'itemid', title: 'Item ID', width: 80},
                        {field: 'productid', title: 'Product ID', width: 120},
                        {field: 'listprice', title: 'List Price', width: 80, align: 'right'},
                        {field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right'},
                        {field: 'attr1', title: 'Attribute', width: 250},
                        {field: 'status', title: 'Status', width: 60, align: 'center'}
                    ]],
                },
                searchbox: {
                    id: "ss_service",
                    menu_id: "mm_service",
                    table_id: "dg_service",
                    select_data: [
                        {name: "new", value: "select_service"},
                        {name: "sport", value: "sport_service"},
                    ]
                },
            }]
        }, {
            text: '仓库管理',
            iconCls: 'icon-more',
            children: [{
                text: '库存列表',
                panel_id: "p_goods_list",
                datagrid: {
                    id: "dg_goods",
                    url: '/easy_ui/test_menu_data',
                    columns: [[
                        {field: 'itemid', title: 'Item ID', width: 80},
                        {field: 'productid', title: 'Product ID', width: 120},
                        {field: 'listprice', title: 'List Price', width: 80, align: 'right'},
                        {field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right'},
                        {field: 'attr1', title: 'Attribute', width: 250},
                        {field: 'status', title: 'Status', width: 60, align: 'center'}
                    ]],
                },
                searchbox: {
                    id: "ss_goods",
                    menu_id: "mm_goods",
                    table_id: "dg_goods",
                    select_data: [
                        {name: "new", value: "select_goods"},
                        {name: "sport", value: "sport_goods"},
                    ]
                },
            }, {
                text: '入账记录',
                panel_id: "p_money_list",
                datagrid: {
                    id: "dg_money",
                    url: '/easy_ui/test_menu_data',
                    columns: [[
                        {field: 'itemid', title: 'Item ID', width: 80},
                        {field: 'productid', title: 'Product ID', width: 120},
                        {field: 'listprice', title: 'List Price', width: 80, align: 'right'},
                        {field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right'},
                        {field: 'attr1', title: 'Attribute', width: 250},
                        {field: 'status', title: 'Status', width: 60, align: 'center'}
                    ]],
                },
                searchbox: {
                    id: "ss_money",
                    menu_id: "mm_money",
                    table_id: "dg_money",
                    select_data: [
                        {name: "new", value: "select_money"},
                        {name: "sport", value: "sport_money"},
                    ]
                },
            }, {
                text: '库房列表',
                panel_id: "p_room_list",
                datagrid: {
                    id: "dg_room",
                    url: '/easy_ui/test_menu_data',
                    columns: [[
                        {field: 'itemid', title: 'Item ID', width: 80},
                        {field: 'productid', title: 'Product ID', width: 120},
                        {field: 'listprice', title: 'List Price', width: 80, align: 'right'},
                        {field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right'},
                        {field: 'attr1', title: 'Attribute', width: 250},
                        {field: 'status', title: 'Status', width: 60, align: 'center'}
                    ]],
                },
                searchbox: {
                    id: "ss_room",
                    menu_id: "mm_room",
                    table_id: "dg_room",
                    select_data: [
                        {name: "new", value: "select_room"},
                        {name: "sport", value: "sport_room"},
                    ]
                },
            },]
        }];
        $(".easyui-panel").hide()
        init_sidemenu(panel_parent_id, menu_data)
    });
</script>
</body>
</html>